Ported changes from master to eden-branch