Fix functions and stuff