Corrected few bugs