Fix multiple resources with the same format

Fixes #65 and #72.