syntax fixes in shape.py