fixes from the erc branch