Replaced a couple of unhelpful exceptions.