Initial diff implementation
A few random fixes