Misc fixed to make compatible with latest pht beta release