A few fixes for RTL support