various fixes of github issues (#361, #360, #359, #356, #265, #264