Simplified exit function.