Fixed 'speed' variable bug