Fixed issue when a username is not specified at the cli or csv
Other bug and logic fixes