/MAP: check depth != 0 before writing backwards