Fix almost all warnings, fix #30