Added few fixes and more tests