Fix depth bug