Bugfixes in lower bound calculation and speed up in prediction loop