Fix nasty flags bug in models

All service models had a bug in flags() where it was returning 0 always
instead of the flag mask, making any edit functinality not work on the
table.