Make sure currentDirection is a string before using String methods.
Fixed a bad 'this' reference in color.js