Better clearing of variables. Improved the Texture->Canvas conversion method.