Minor improvments to case class conversion