Cleanup and corrections

Cleaning up some code and fixing a message.