Fixed small bugs in square.c