Fixed some painting canvas issues