Fixed calculation of click coordinates which did not work for Firefox.