Tests and fixes to funcs