Fixed two bugs. Added more error message boxes