Fixed bugs:
1. Fixed sign error with acceleration limit feature.
2. Fixed flag issues