Cleaned up messages and more error checking