Bug fix #11 Additional changes

Moved debug message to bottom
Add more error checking for deleting error message after they appear