Fix rectangle intersection for all cases.