compile fixes for mac/posix