Fixed issues found in code review