fix #168, fix #167, fix #166, fix #159, fix #158, fix #157, fix #156, fix #154