all basic expand cases covered in tests;bugs fixed