Fixed bits I broke in postgre and also fixed incorrect ordering of parameters when calling some sprocs