Updated loki and various other fixes