Fixed kernel for boundary checks