bug fixes for #474