Fixed bugs

- Fixed a bug on Unix where StartThread would return improper result