Adjustments to localflavor import

preferring external localflavor, and narrowing the exception catching