Fixed some minor issues found with code inspector