Fix #377

This is not a very beautiful solution, but reading the output line seems to be the only solution, because return value is not set to 0 when an empty command is run.