Adjust some if's so that we only throw an error when we need to; using the AND was making personid NULL.