Use correct prototypes
return NULL over -1