fixed z_at[] cache getting out of sync on load

fixes #2731
fixes #2730