More unit testing fixes for #971 and #972