BUG: lookup commit could return a bogus object

If the find did not find anything it would still try and
return something even though it was a bad object. This
was fixed by checking if the commitItor returned is not at
the end of the itor.
BUG: Remove all warning

This patch removes all of the warnings that were seen
during compile times.

Goal is to keep warnings down to 0.