Minor changes to be able to compile on systems non conforming to POSIX.1-2008 (hi, Mac!)