Fixed bug: range.collapse was incorrectly being called with no arguments. This caused an error in Firefox (but not elsewhere).