Fixed the bug in tsosaikf (x instead of x_prior), things seem to work nicely now.