Corrected several return values, added some casts in case the user is not using a pointer for an entry / key, and refactored a loop.
Corrected several return values, added some casts in case the user is not using a pointer for an entry / key, and refactored a loop.

sprowell/he4