Fix null pointer in depend resolution. This closes issue #515.