some bugfix & test for spack