add more argument error checking and tests for same