Also fix a number (several too many) bugs that found their way into the system following the previous few commits