Added ZPDecoder and strict mode. Some little fixes and refactor Not tested