Fixed backwards compatibility with old perl versions on hashref