Fix a bug in initialisation and implements few more tests.