Fixed depth bug