Importing fixes from MediaWiki_Api