Updated loki and various other fixes

Change-Id: I215e4517d3c0b4bd01eb4a572ea565241c7bbbae