  We study the directional-ordering transition in the two-dimensional classical
and quantum compass models on the square lattice by means of Monte Carlo
simulations. An improved algorithm is presented which builds on the Wolff
cluster algorithm in one-dimensional subspaces of the configuration space. This
improvement allows us to study classical systems up to $L=512$. Based on the
new algorithm we give evidence for the presence of strongly anomalous scaling
for periodic boundary conditions which is much worse than anticipated before.
We propose and study alternative boundary conditions for the compass model
which do not make use of extended configuration spaces and show that they
completely remove the problem with finite-size scaling. In the last part, we
apply these boundary conditions to the quantum problem and present a
considerably improved estimate for the critical temperature which should be of
interest for future studies on the compass model. Our investigation identifies
a strong one-dimensional magnetic ordering tendency with a large correlation
length as the cause of the unusual scaling and moreover allows for a precise
quantification of the anomalous length scale involved.
