Better check of external module availability
Fix external module check on OS X.