Correctly handle Resources

This fixes issue #28.