Move logic around for sglEnter/sglExit functions - add early returns