Improved nil-in-list detection