Good catch.

```
Application
Application-Deleted
RemoteApp
RemoteApp-Deleted
```
You can (not so intuitively) tell if an `Application`/`RemoteApp` doc is a build or the working version because the working version will have `doc.copy_of` set to `null`, could `return doc.copy_of ? doc.built_on : null;`.