Ported all bugs from trunk to stable