Improve error reporting and allow compilation with Linux versions > 3.0