[2.0.0] Unit tests fixes

Hi,

@phalcon - please do not merge this PR yet. I would like to keep it open as I will add changes to it.

Thanks in advance,

Kamil