Fix iteration over dictionary