Moved struct flags to an enum
Removed tokens after #endif directive, fixes compiler warning
Added missing struct flags
Added missing licence headers