Portability

- Reordered includes to allow build on FreeBSD (thanks to Pietro Cerutti).