Fixed to work with scipy 0.12