Fixed and added a test for resources