Fixed flags constants, to reflect the ones in magic.h
New test cases