Fixes for clipboard issues

Fixes #280