Final edits to perf for compilation (and some silly error fixes)