Added more tests and small code changes to ExpandComponent