Bugfix for append and prepend methods