Fixed a bug that caused an infinite loop in the browser.