Bug fixes and style updates