Handle MAGIC_NONE (no flags set) case correctly.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>