Fixing few bugs