fixed some indexing issues / logic bugs in expand.
fixed some minor issues in goal test, interface code.