Use type asserted value in switch statement

This is useful to avoid repeating the type assertion. Thanks @davewiner
for teaching me this!
Use int64 like Redis does