Fix silly typos and refactor polyfunctionality plotting code