Fix comparison with origin
Remove unused stuff