Fixed bug in mapper depth check