A few fixes, code-clean up.

Win7