Fixing error message logic.