Clean up warnings, tighten up types.