Clean up dictionary usage. Fixes #292