Replaced System.out.println() calls with a logger and removed several compiler warnings.