parameterize tests and fix some errors