Fixed and improved plan and profile

that's kind of a strange function name