Fixed print_r of entities causing out of memory errors