Yes get well soon!
I've found that according to the ketostix, I can just about stay in ketosis even on the days where for one reason or another I end up consuming up to 60g carbs, so it's more than possible you are staying in it with 40g although like others say, don't do anything detrimental...