Fixed mishandling of failed step in ezstep and added a test for failed case