Refs #2866: Changed Paint serialization method to avoid StringIndexOutOfBoundsException.