Bug fixes and adding extra features