Corrected append and prepend methods, which were failing when animate was false