Added permalink + various bugfixes