Make release smarter.
Closes #340