Formatting changes, bug fixes