Fix warnings
Use optimizations in release.
Optimize makes compilation very slow.