Ported some minor methods to XS