Fixed 'dataset_id may be used unititialised' error, and minor changes to laser sorting part