Maximum search fixed