Added changes given by @nulltoken. Also added similar changes to test for non fast forward.