Fix edge cases seemingly broken in 80e320a9