Added explicit check for control characters as well.