Fixed some issues with parameter passing.