math fixes in empty shape