Fix dictionary return value bug