Fixed a JS bug that could cause ajax submissions not to function properly.