netcmd: Avoid catching all exceptions, avoid using ';' at the end of lines.