Merge from deadknight's branch.