Fixed bug where layer count wasn't getting filled in on sidebar collapse
Fixed layer ordering when coming in via permalink