close input stream resources, fix minor Eclipse warnings
fix some Sonar issues