Allow kwargs to be passed to optimise(). Fixed bug in prior generator