Bugfix: avoid exceptions for certain invalid payloads

Eg an array instead of a hash, empty hash