Small fix to make non integer id fields work.

This check makes the last id something else if the insert id is passed as 0.