diff --git a/patches/database_strip_html.diff b/patches/database_strip_html.diff
new file mode 100644
index 0000000000000000000000000000000000000000..b56865f0c41cddbc6e590a2a59b3b1817ab58b14
--- /dev/null
+++ b/patches/database_strip_html.diff
@@ -0,0 +1,15 @@
+Index: database.php
+===================================================================
+--- database.php	(revision 3939)
++++ database.php	(working copy)
+@@ -612,6 +612,10 @@
+ 	 * @return string Sanitised string
+ 	 */
+         function sanitise_string($string) {
++            while($string != html_entity_decode($string)) {
++                $string = html_entity_decode($string);
++            }
++            $string = strip_tags($string);
+         	return mysql_real_escape_string(trim($string));
+         }
+         
diff --git a/patches/relationship_get_set_public.diff b/patches/relationship_get_set_public.diff
new file mode 100644
index 0000000000000000000000000000000000000000..455dead58ef61d30aedfa72df7007863c1d466e8
--- /dev/null
+++ b/patches/relationship_get_set_public.diff
@@ -0,0 +1,24 @@
+### Eclipse Workspace Patch 1.0
+#P UNL_Elgg
+Index: elgg/engine/lib/relationships.php
+===================================================================
+--- elgg/engine/lib/relationships.php	(revision 3938)
++++ elgg/engine/lib/relationships.php	(working copy)
+@@ -60,7 +60,7 @@
+ 		 * @param string $name
+ 		 * @return mixed
+ 		 */
+-		protected function __get($name) {
++		public function __get($name) {
+ 			if (isset($this->attributes[$name])) 
+ 				return $this->attributes[$name];
+ 	
+@@ -74,7 +74,7 @@
+ 		 * @param mixed $value
+ 		 * @return mixed
+ 		 */
+-		protected function __set($name, $value) {
++		public function __set($name, $value) {
+ 			$this->attributes[$name] = $value;
+ 			return true;
+ 		}
diff --git a/setup.sh b/setup.sh
index 6f65b12192052997e14e8cc1528521d108c496fd..63c2f217063f23a507f900009e19ae044ac700c9 100755
--- a/setup.sh
+++ b/setup.sh
@@ -1,11 +1,14 @@
 # Make a directory for elgg data files outside the root
-mkdir elgg_data
+mkdir elgg_data &> /dev/null
 
  
 
 #Do patches
-cd elgg
-patch -p0 < ../patches/lowercase_post.diff
-cd mod/groups
-patch -p0 < ../../../patches/add_closing_labels.diff
+patch -p0 -s -N  -r tmp.rej                   < patches/relationship_get_set_public.diff > /dev/null
+patch -p0 -s -N -d elgg -r tmp.rej            < patches/lowercase_post.diff              > /dev/null
+patch -p0 -s -N -d elgg/engine/lib -r tmp.rej < patches/database_strip_html.diff         > /dev/null
+patch -p0 -s -N -d elgg/mod/groups -r tmp.rej < patches/add_closing_labels.diff          > /dev/null
+rm tmp.rej
+
+echo 'Setup successful'