fixed #177 - forgot to restore context when fixing stack problem (#168 had broken it)