Reverted back to JDK 7 as support for older versions can not be guaranteed.
Added -Xlint=unchecked to compile options and fixed unsafe warning.