Linux fix; needs further debugging