Various fixes

- Re-used the `newPivotStatement`
- Fixed some typos
- Fixed some incorrect return types
- Fixed incorrect property