Stack overflow fix

The flags variable is of type int, when reading from and writing to
it via an uint64_t *, the behavior is undefined but can be really bad.
Merge pull request #150 from cbreak-black/incompatible_pointer

Stack overflow fix