Re-implermented fixes due to code loss.