errors raised when compiled with debug option fixed