Fixed some bugs in resources manager. Closes #152
Submodule update
Merge pull request #157 from kitan1982/fix-issue-152

Fix issue 152