Bug fixes and minor updates