Fixed a double painting bug