Various bugs fixed

- Some issues with editor fixed
- mysql_real_escape_string() issue fixed
- Some gameplay fixes