Fix script and NPE in LoginCommand