Updated various warnings and modified to work with Java 8.