Corrected Errors.

Removed the bugs on code.