Some minor syntax and safety wrapping fixes