Add autolocate option. Fixes #4