More robust local_depth error handling.