Issue4547

Sorry about the re-post, I made a mistake with Github's native app.
This fixes #4547. Requested changes have been added.