Cleaned up code a tiny bit in misc.c, removed old versions of functions