More tests and related fixes to bridge detection. #1917