Fix windows shell bug and add context manager contributions