Fix regression with page detection