Fixed a crash bug when flattening models with roles and serializables.

The default behavior with flatten is to exclude serializables (as the main use-case
for flatten is redis hashes and serializables can be derived from other data).
This bug showed itself when you mixed roles with serializables as filtering
by role forgot to exclude the serializables.