Fix empty maneuver box error, make code more resilient