PSR conformance, bug fixes and added debugDump()