Fix primary painting issues