Fixed a future issue and added a few tests