My take at #1198

This hopefully fixes #1198 and while it doesn't solve the underlying problem mentioned in #1429, it does tackle the resulting mess. :)