[WIP] Fix clang analysis warnings. (2)

This continues the work in #1389.

Fixed 4 warnings in `ex_cmds.c`.
Will be adding more to this PR until 20 warnings or so are fixed.