Fixed missing calls to resize. Code cleanup, work on performance.