Bug: if parameters are null, need clear error/warning

Currently:

Error in if (d == "positive") { : argument is of length zero