Make code more robust against user error.