Fixes depth bug