Fixed bug during command execution tha resulted in duplicate execution
in some cases.