(maint) Fix problems due to ruby 1.8.7 not returning Hash

Ruby 1.8.7 select and reject does not return a Hash when applied
to one. This fix constructs a new Hash if one is not produced.

This commit also contains a fix of a typo in exception name (ParserError
instead of ParseError).