Autofocus. Closes #310.