Revise spec and tighten up semantic checking of constant values