Fixed various bugs; seems ready for full round of tests (of type flowcdf or bytes)