Fixes to bring Range implementation into line with DOM4 spec