Fixed bug that caused program to always overwrite error message with default one when something when wrong.