a few trivial bug fixes