Fix some edge cases in 8f8bd88c (#7134)

Signed-off-by: Austin Seipp <austin@well-typed.com>