Formatting and warnings tidy up