fix tests and lazy-load resources