#350 public __sleep() results in BadMethodCallException

See issue #350