Copied from flynn/slugrunner