Fixes for small board sizes
Works for size 4, but not for size 9