Copied changes from FifthGear