Fixes #247
Fixes #249 Fixes #248 Fixes #247 fixes #246