Adding fixes for the fork based implementation, also removed some redundant code...