Fixed a bug that incorrectly calculated the remaining space within the linear layout.