Added flags with default values.
Create empty flags array to save space.
Fixed typo.
Changed name of the flags variable
Fixed conditional inclusion of tensor/flags.h
Simplified the code for flags, imposing that always a value is given.