Set java platform 1.7 as the default and a minor code fix