Improve error handling in _parse_template method.
Implement toggle operation with target for params.
Add tests for toggle operation with target for params.