This PR addreses the problem introduced after #3766. Fixes #3941 Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>