Merge "Fix temporary file creation and cleanup during testing"