Fix a compilation error; some style issues; and a crash.