fixed signed unsigned issues
better error detection for textures