Merge "Improve detection of already loaded libraries"