#1815

Fix for issues mentioned by @c0bra in #1815