Added some fixes as part of the code clean up.