Code review

Made a code review and fixed small issues