Fixing few more bugs and adding code to increase the code coverage