Fix segfault caused by baseline index going beyond the limit. In the original code we have some strange artificial dimension here. When corrected it segfaults. Need to ask specialists.