try our best to prevent deopt

[fixes #123]