resources: tests and a few accompanying fixes