Several small fixes for python3 compatibility.

Discovered these additional python3 issues while using the command line options.