Added ability to pass structs as refs instead of copies.