Bug fix for the stepping feature

Sometimes setting wrong values was possible.