Latest successful logic improvement

Change-Id: I58bc100cec209946d9a326d7bb1fbfb02b228955
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>