Fix for entry/exit handling