Some changes on js behavior + a ton of tests