Fix bugs discovered in MMVA testing.