miscellaneous tweaks to code, no docs yet