I wonder if this might break things for mplot3d. I see what you are trying to fix, but there has to be some other way to identify the axes that should have 0 returned for this function.  Perhaps each axes type should have a function defined for themselves to return the appropriate value?