T1851

processing-js.lighthouseapp.com/projects/41284/tickets/1851

I added the fix along with a test.