Fixed major bug in time-phase marginalisation; seems to work now.

Testing ongoing.