Bug fix and few minor changes.