Code cleanups.

Some code clean ups etc.