fixes for #594