Wrote some function composition tests and fixed a bug with pivot