Minor corner case fixes