fixes and new tests for ajax stuff