* Bug fixes and style improvements