Fixes #350
Fixes #344
Fix related to #329