Fixed resources bugs