Better handling of incorrect input strings