fixed detection of toolkit dependencies by also taking previously loaded modules into account (refs #245)