Bug fixes and more