Fix textarea bug, reformat code