Fixed few bugs and added new functionalities.