PROV-552 Fix for broken lot editor; also fix related problems in loans and movements