Bug fixes to get working on beamline