Fixed bug where parameters were not referenced correctly