Perf fixes and wired up layer manipulation.