Optimized some processes.
Defined NDEBUG for assert() in all codes. This is for performance.