Got rid of some redundant code.
Minor formatting edits.
Changed "0" to "nullptr" in various places.