Fixed multiple prepend and append and added tests