Clean up gradient parsing.
Created attachment 293183 [details] Patch
Created attachment 293184 [details] Patch
Fixed in r208062.