Add runner factory spec and fix issues