some bug fixes in Bruteforce and SP marginalization