Fix for issue #566 & #545.