add public interface for context switch, minor fixes