Continued bug fixing

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