Added more test functions. Also cleaned them up a bit