Fix the query extension to handle blocks that end in nil.