Few fixes and added more tests