Fixed reverse paint/null pointer errors