Fix some more runtime bugs and add more debug info to error messages.

Also added a test case for the fractional number lexing bug I fixed earlier today.