Fixed wrap around bug