Improve height calculation and placement of textarea