Fixed bugs related to last three commits