Fixed problems after Edworgs's commits