Removed several bugs from the changes in texture and IDmanager