Quelled some warnings, made code compatible with Java 6.