Updated comments about addData
Fixed some NPE potential pitfalls