fix tests
fix compilation under 1.8
review clean up