Fixed bugs related to accepting invalid strings