Fixed folder detection in init script