Pull in Andos' OSF changes

Have to merge this one manually (probably my fault and not Andos')