Applied patch from HaikuPorts