Fixed a dumb bug in thread creation