Bug fixes and some new functionalities