Fix renaming application bundle on Mac

Closes #960.