merge pr/592

cherry picked @ryanlittleton's c67ebc0eee6ba4219f3a3e2ddf06ea323e2df3be

should supersede (and close) #592