Cleaned up code and made less annoying error messages