Fixed a problem with the #on_document? navigation method.