Working tests, one messed up bug and new exported functions