Add tests and fix whitespace parsing errors.