Two bugs caught w/ scan-build