Fixing arg parsing and connection errors