BUG: fix for #509
Merge pull request #510 from sjsrey/b509

BUG: fix for #509