Handle blank input strings gracefully (fixes #21)