fixing up straggler unit tests
fixed rewrite_typed for fancy indexing