Return Surface objects by reference from SurfaceCollection objects and fix a bug in XS code causing some shell options to be ignored