Refactored a bit.
Fixed remote-amend conflict.