Fix warnings and main module