some cleanings and fixes to compile with stricter flags