Fixed onMouseClick throwing an error when mouseup on element where not mousedown.