fix bugs with ZP cache use. Issue #12.