Add global to module append in if block
Update truth test of index to support null