add tests and fix pbe class definition.