Bug fixes and update