Added @safe and @trusted in a bunch of places