Bugs/1181

Fix for #1181... take 2