Fixed 'shell' function.
Implemented thread reading on Windows - was missing