Fixed boundary errors