Fix some formatting stuff and R0 bugs