Fix for ticket #1223