Fix some warnings and win newlines, and add better coverage