minor bug fixes and style changes