diff --git a/mod/wiki/lang/en/wiki.php b/mod/wiki/lang/en/wiki.php
index f6bba6f..133a2fd 100644
--- a/mod/wiki/lang/en/wiki.php
+++ b/mod/wiki/lang/en/wiki.php
@@ -20,8 +20,6 @@ $string['backoldversion'] = 'Back to old version';
 $string['backpage'] = 'Back to page';
 $string['backtomapmenu'] = 'Back to map menu';
 $string['changerate'] = 'Do you wish to change it?';
-$string['insertimage'] = 'Insert an image...';
-$string['insertimage_help'] = 'This drop-down list will insert an image to the wiki editor. If you need to add more images to the wiki, please use "Files" tab.';
 $string['cannotmanagefiles'] = 'You don\'t have permission to manage the wiki files.';
 $string['cannotviewfiles'] = 'You don\'t have permission to view the wiki files.';
 $string['comparesel'] = 'Compare selected';
@@ -85,6 +83,8 @@ $string['history'] = 'History';
 $string['history_help'] = 'The history lists links to previous versions of the page.';
 $string['html'] = 'HTML';
 $string['insertcomment'] = 'Insert comment';
+$string['insertimage'] = 'Insert an image...';
+$string['insertimage_help'] = 'This drop-down list will insert an image to the wiki editor. If you need to add more images to the wiki, please use "Files" tab.';
 $string['invalidlock'] = 'This page is already locked by another user.';
 $string['invalidparameters'] = 'Invalid parameters have been given.';
 $string['invalidsesskey'] = 'The given sesskey is not valid. Please resend data again';
diff --git a/mod/wiki/locallib.php b/mod/wiki/locallib.php
index 762a76a..6bd8768 100644
--- a/mod/wiki/locallib.php
+++ b/mod/wiki/locallib.php
@@ -578,7 +578,8 @@ function wiki_parse_content($markup, $pagecontent, $options = array()) {
     $cm = get_coursemodule_from_instance("wiki", $subwiki->wikiid);
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
 
-    $parser_options = array('link_callback' => '/mod/wiki/locallib.php:wiki_parser_link',
+    $parser_options = array(
+        'link_callback' => '/mod/wiki/locallib.php:wiki_parser_link',
         'link_callback_args' => array('swid' => $options['swid']),
         'table_callback' => '/mod/wiki/locallib.php:wiki_parser_table',
         'real_path_callback' => '/mod/wiki/locallib.php:wiki_parser_real_path',
@@ -675,12 +676,13 @@ function wiki_parser_table($table) {
 /**
  * Returns an absolute path link, unless there is no such link.
  *
- * @param string url Link's URL or filename
- * @param stdClass context filearea params
- * @param string filearea
- * @param int fileareaid
+ * @param string $url Link's URL or filename
+ * @param stdClass $context filearea params
+ * @param string $component The component the file is associated with
+ * @param string $filearea The filearea the file is stored in
+ * @param int $swid Sub wiki id
  *
- * @return File full path
+ * @return string URL for files full path
  */
 
 function wiki_parser_real_path($url, $context, $component, $filearea, $swid) {
diff --git a/mod/wiki/renderer.php b/mod/wiki/renderer.php
index 7bfca6f..8853b76 100644
--- a/mod/wiki/renderer.php
+++ b/mod/wiki/renderer.php
@@ -298,18 +298,17 @@ class mod_wiki_renderer extends plugin_renderer_base {
         return $html;
     }
 
-    public function wiki_print_subwiki_selector($wiki, $subwiki, $page, $pagetype) {
+    public function wiki_print_subwiki_selector($wiki, $subwiki, $page, $pagetype = 'view') {
         global $CFG, $USER;
         require_once($CFG->dirroot . '/user/lib.php');
         switch ($pagetype) {
-        case 'view':
-            $baseurl = new moodle_url('/mod/wiki/view.php');
-            break;
         case 'files':
             $baseurl = new moodle_url('/mod/wiki/files.php');
             break;
+        case 'view':
         default:
-            $baseurl = null;
+            $baseurl = new moodle_url('/mod/wiki/view.php');
+            break;
         }
 
         $cm = get_coursemodule_from_instance('wiki', $wiki->id);
@@ -478,7 +477,7 @@ class mod_wiki_renderer extends plugin_renderer_base {
         $select->label = get_string('mapmenu', 'wiki') . ': ';
         return $this->output->container($this->output->render($select), 'midpad');
     }
-    function wiki_files_tree($context, $subwiki) {
+    public function wiki_files_tree($context, $subwiki) {
         return $this->render(new wiki_files_tree($context, $subwiki));
     }
     public function render_wiki_files_tree(wiki_files_tree $tree) {
