Issue390

fixes #390 and #391