Fix off by one error in object depth sorting

Jeremy spotted this one.