LCD_KCAL: Fix improper bounds checking