Apply modified patch for issue #10 on behalf of freemangordon, need probably some upfix for Fremantle