Fixed translation bugs and added more test cases for translation.