fixed bugs in ExactInference

@karlnapf 
fixed bugs mentioned in https://github.com/shogun-toolbox/shogun/issues/2375