Fixed problem that was found in Debug mode only