Build to a temporary folder only if necessary. Fixes #82.