fix bug where # of params exposed was incorrect. credit to Bert Thomas <bthomas@brothom.nl>