Fixed lots of warnings based on new 1.7 stuff (a.o. diamond notation and
try-with-resources)