Some fixes

It looks like `factorial` moved in `scipy` ... fixed in 2d1a9d8
cfd22ce is a cleanup to use the recommended `import numpy as np`.