On the Noether-Lefschetz theorem and some remarks on codimension-two cycles