Style changes, including some bug fixes