Removed some unused return lines. Clear the painter on exit.