Fixed python threading issue also addressing review comments.