Fixed bug in orthographizing function.