Fix some bugs in the MAP parameters calculator