Fix compile error, improved speed restoration