Various changes from original repository