Fix compiler warning for unused variable
Remove some unreachable code