Check if otu.metadata_hash not nil before calling each

Fixes #192