Fixed some additional bugs