Bug fixes as in MOM. Batch 1