Fixed integer conversions.
Fixed autoincrement issue.