Minor fix to cache dependencies of hasModule().