Fix painting issues