Corrected bugs

Corrected bugs