[642] Added tests and fixed a couple of isses which they raised