Added step tests
did some bug fixes.