Fixed issue with execute-command not returning correct status