Ajax fixes by Frank