Fix bug in read painter.