fixed some bugs in module dependencies