The failure cases here seem repetitive, but this looks generally good.