Fixed some of the unit test cases that were not true async.  Also fixed some js syntax issues