Patch Set 7:

@Matthias:
This NPE is one of issues that 'should never happen' ;) I've already fix it. Should I push this small change to gerrit ?

@Robin:
Good point! This is quite huge change and we can have many strange issues and regressions. I'll start working on test coverage for this part today.