several bidi improvements