Fix bugs in test step definitions