Properly validating user input closes #46