Fix compiling

Also minor formatting changes