Move code before the `return` statements.
Remove dead code.

Fixes CID 993701.
Add missing comma.

Fixes CID 1192559.