Small corrections, some functions relocated, others removed