scalacheck has helped find a bug