General cleanup and fixing a few null sets where it can only be null,general warning fixes. (commit: ccc53b5)