Fix switch warnings
Fix const char correctness warnings
Fix if and else ambiguous warnings
define out hdrstop