Handle exceptions thrown when creating test commands

Part of #19