fixes for 66c4cfb9604db104be2e77639f38f8fe05160d7a