Fix wrong @eachkey scope, add @eachkey tests