Warnings - use size_t where appropriate to prevent warning when compilation is targeting 64 bit

Cast error.position to unsigned long when calling fprintf