Fix dict function