better error guards

No, I think this is good. It just wasn't clear why you added this since the rest of the diff wasn't affected by it.