Formatting and validation fixes