Fixed loop condition in Axis tick generation