Fixed bugs created from the previous commit