Added StackAsArray class and fixed some minor issues.