Update unit tests

Please check individual commits.