Fix sid generator generating invalid sids after sid 999