Changed flag reading

It now outputs either 0 or 1 instead of 0 or a big non-zero number.