Style changes and bug fixes