fix crash with -gamma (nw)

I think this is correct.. or at least more correct than it was, there's no way the existing code could work.
Fixed validation. (nw)