Various updates including better handling of dark subtraction