Added simple parameter checking for function calls