Adding few bug fixes