Robust key fetching

Fixes #31