Small update: fixed some bugs in ResManager.