special handling for square terms, fixes #308
Merge pull request #311 from JuliaOpt/fix308

special handling for square terms