Fixed future/signal bugs and added sortby tests (fixing a sortby bug in the process). Now all tests pass.