Fixed bug in check() for immediates.
If internal representation is uint64_t, check should cast to int64_t().
Otherwise, a narrowing cast will always succeed.