Fix bulk insert bug