added better exception handling, clearer non-joke messages, removed some casts to string type, etc