Fix diff code issues