rebase: one safety net, one bugfix and one optimization.