Stability Improved

1. Add 'volatile' for some variables.
2. Now optimization -O3 is OK.