Fxied a bug uncovered by the shale-python tests.