Fixing couple of minor issues and some modifications

Some minor fixes and modifications.