Fixed all eclipse warnings. Made it type safe.