Some basic functions/tests/fixes