bug fixes and style updates