Use type::operator pattern in error messages
Remove redundant dependencies in cmake files
Fix crash when opening a stream while another one is active
Fix unit tests