fixes to background painting