Fixed permalink, code improvements