Effect of boundary conditions on the behavior of Bloch electrons