Fix some bugs in annotation transform.