fix key capturing to handle expr mappings when possible

fixes #114