Minor bug fixes. Formatting