Fix a crash when using the options dialog opened from the command-line.

347e8bb4919e5257897edc70ab29ef98563a0687 forgot to add the needed null-check to filter out the cases where the active window was returned.
switch statements: Document intentional fall through.

Fixes CID 1130513 and 1130514.
Use a bitcheck instead of casting (WIP).

Fixes CID #965944.