Initial Commit.
Some code cleanups and minor tweaks.