more work on module manager
fixes a couple of bugs.