Fix for #366.