Simple code clean up and removal of warnings