Resolves issue #127, and fixes permalink error uploading new media.