Boundary conditions and scaling functions of percolation models