Most funtions now work as expected.