Cleaned up more misc code