Fixes #1123
#1123 Better fix