Several fixes from review
Improve tests