bug fixes and style update