Corrected wrong testing in Ajax calls.