Remove nil values from hash generated by #to_hash