Slightly improved input checking

Use isspace() instead of checking for strip() == " "