Fixed Bug for negative Z Layer