Another bug fix to switch target.
Another minor bug fix
Fixed minor bugs