Added 'if(MESSAGE_LEVEL > NONE)' before all fprintf() and fclose() statements
Added 'if(MESSAGE_LEVEL > NONE)' before all fclose() statements