Ran code through an analyzer and fixed up things