Delete nil values in hash. This is to avoid issues with older versions
of activesupport