Code cleanup and Null pointers fixed
