Thanks Alexey!
Any thoughts on this thread? That link points to the original problem I had, and when trying to reproduce with logging I then ran into the problem described here.
The other issue seems like a much bigger error, since everything appears to compile fine but the generated code is incorrect.