#14 Correct some issues found in code review