Add doc comments
Fix a bunch of warnings