add autoincrement mixin. correct error reporting.