Replaced System.out.println() calls with a logger and fixed a few compiler warnings.