Minor code cleanup in texture code