Fixed issues with Square functions