Fix promise error handlers
Fix clientId setting on command-line