fixed/improved nextAutoIncrement