Updated minor bugs in threading