fixed some unguarded dict accesses