Removed more compatibility functions, rewriting some scripts