Fix some boundary errors