Use to_hash (instead of Hash, thanks ruby 1.9.3); remove trailing whitespace