Updated test suite, fixed some small issues with resource validity detection.