Fix SCL-4483

I ran into [SCL-4483](http://youtrack.jetbrains.com/issue/SCL-4483)  about two weeks ago and finally decided to take a crack at fixing it. The changes are pretty straightforward. Thanks for your consideration.