bug fix
various fixes