Various updates to sub folder code.
Updated the way PHT is handled. Now uses the same code as the rest of the clients.
Tidied a few things up.