Replace hasNext with next - Fix #45