Updated texture code for 1.5.1.