You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Const-Correctness is only slowly progressing because Niko does not really like it. So we have to push it in really careful. But it's under construction