indentation fixes, added catching trailingslashits, catch for when permalinks are turned off