Minor bug fixes and changes