Bug fixes and other stuff added