pep8 fixes and fixed race when an instance isn't starting