Fix (almost) all warnings