Fix for target framework issue

Fixes #1826