Improvements for open bsd support