Add minor NPE fix, basic unit tests