Fix table issues -> integer to bigint in functions