Add test for local computation of MAP in ALS and a few fixes