Added sort paths and fixed some sorting bugs.  Cleaned up the code for handling nulls in filters.