Adjusting speedSwitch. Improved directive error handling