Adding nullcheck and use Self.Types
Add more unit-tests for IndicesStats