Fixed fillTexture function