Fixed bug that happened when there were no textures