Remove some functions, other minor fixes