Fixes some of issue #1275