Initialise some variables $cmd and $status - thanks Petr