Don't use 'return' where you should use 'PG_RETURN_xxx'.