Fixed Z filp and improved sampling reliability

Now samples from top and bottom 3rd in Z avoiding middle 3rd - gives
more consistent data for Z flip judgement.