Now working in Mac case.

Lots more testing and fixing on Win & Linux required.