fixed a whole bunch of bugs in analyses