Fixed class reference
Added example for flattening entities