Cosmetic changes and removed an unused variable.
More cosmetic changes and a fix to creating a new object.