Use -1 as return value instead of NULL