Remove unused variable
Fix type logic