replaced NULL references with a global nl_null pointer, which allows a bunch of null checks to be removed (hopefully increasing speed) and prevents potential segfaults