Fixed calculation of module dependency list

When looking for dependent modules the code was accepting all cases
where a process name was specified (i.e. the pointer was non zero)
rather than taking all cases when it was not specified (pointer 0).