Code cleanup, fixes, meh