Fixed dict iteration and hence improved class printing.