Fixed error handling in bridge.