correctly bind parameters. closes #1440, #1439
Merge pull request #1449 from rojblake/bind_fix

correctly bind parameters. closes #1440, #1439