Add braces.
Fix #390.
Use out parameter to match closely the API.
Update tools.
Fix #392.