Formatting and compilation fixes