Major cleanup and bug introduction ;-)