Minor fixes to logging and fixed small bug that wouldn't allow exit