Fixed mistake in << signature and added unit tests to it