Adds checks for NSNull and several other memory improvements (graph view).