Commit ported and tested code.