Here's a bit of code that caused downstream problems in my game resulting in OOPS messages. My use case was debugging the results from checking flags and got nailed when the gFlags index was 16.
(DebugPrint "Flag value = %d" (Btest MY_FLAG))
Simplified, you can get the same result with:
(DebugPrint "Flag value = %d" $8000)
It returns "Flag value = -4294934528", which is an overflow for a 16 bit integer - I should have used %x instead
