Rearranged parameter order, and updated tests accordingly.