Fix issue #5 and lil fixes