fix resource leaks;
clean up intelliJ analysis, update copyright