handle some extra error cases. minor formatting