fix a couple of issues and remove unused using