more bug fixes

Signed-off-by: unknown <trpb2@EPIDPC147.mrc-epid.cam.ac.uk>