Handle whitespace correctly when splitting with flags.

Fixes #248.