Cleanup of warnings and some tests