Fix uninitialized scalar variable.

Fixes CID #966220 #966223.
Improve the Get(Cur)DispMode and SetDispMode functions.

Fixes CID #966222.