A few fixes for bugs (and include-file issues) found after building for Release