Fix 1-based bug