Correction of a few bugs