fixes for #1078

fixes mentioned in comments in #1078