Fixed troubles

Fixed troubles from code review