Fixing diff functions.