Fixed bugs around %n not working correctly.