diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6f886b21bd1251f7bf89cf66a18ffc07d11fe34b..ed678d6194965c27857e8e48fb54c4d4de456086 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,9 +2,12 @@ cmake_minimum_required(VERSION 2.6)
 
 project(citra)
 
+SET(GCC_COVERAGE_COMPILE_FLAGS "-std=c++11 -fpermissive")
+
 # silence some spam
 add_definitions(-Wno-attributes)
 add_definitions(-DSINGLETHREADED)
+add_definitions(${GCC_COVERAGE_COMPILE_FLAGS})
 
 # dependency checking
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeTests)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0816147b8083fecee50f95f1b3d5136e2ddeb221..e0227dc5351749bdd7e59e7c4eb0713bdf8970cd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,7 +1,8 @@
 add_subdirectory(common)
 add_subdirectory(core)
-add_subdirectory(citra)
 add_subdirectory(video_core)
+add_subdirectory(citra)
+add_subdirectory(citra_qt)
 
 if(QT4_FOUND AND QT_QTCORE_FOUND AND QT_QTGUI_FOUND AND QT_QTOPENGL_FOUND AND NOT DISABLE_QT4)
     #add_subdirectory(citra_qt)
diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt
index c6913df571a52717bc9a65eacc1960a3fc1e9fa1..9b8c3936a5b5c9828717d1ce7a207eed52d83b9d 100644
--- a/src/citra/CMakeLists.txt
+++ b/src/citra/CMakeLists.txt
@@ -7,6 +7,6 @@ if (NOT X11_xf86vmode_LIB)
 endif()
 
 add_executable(citra ${SRCS})
-target_link_libraries(citra core common ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} GLEW rt ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB})
+target_link_libraries(citra core common video_core GLEW glfw3 pthread X11 Xxf86vm Xi ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} rt ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB})
 
 #install(TARGETS citra RUNTIME DESTINATION ${bindir})
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt
index 2b9d4b93c1cf8e63e32da084d144a4f7607f7c38..594460a7153872d7f6446a68ab774ae705b124d7 100644
--- a/src/citra_qt/CMakeLists.txt
+++ b/src/citra_qt/CMakeLists.txt
@@ -1,30 +1,30 @@
 set(SRCS
             bootmanager.cpp
-            callstack.cpp
-            disassembler.cpp
-            registers.cpp
+            debugger/callstack.cpp
+            debugger/disassembler.cpp
+            debugger/ramview.cpp
+            debugger/registers.cpp
             hotkeys.cpp
             main.cpp
-            ramview.cpp
             config/controller_config.cpp
             config/controller_config_util.cpp)
 
 qt4_wrap_ui(UI_HDRS
-                    callstack.ui
-                    disassembler.ui
-                    registers.ui
+                    debugger/callstack.ui
+                    debugger/disassembler.ui
+                    debugger/registers.ui
                     hotkeys.ui
                     main.ui
                     config/controller_config.ui)
 
 qt4_wrap_cpp(MOC_SRCS
                         bootmanager.hxx
-                        callstack.hxx
-                        disassembler.hxx
-                        registers.hxx
+                        debugger/callstack.hxx
+                        debugger/disassembler.hxx
+                        debugger/registers.hxx
+                        debugger/ramview.hxx
                         hotkeys.hxx
                         main.hxx
-                        ramview.hxx
                         config/controller_config.hxx
                         config/controller_config_util.hxx)
 
@@ -33,6 +33,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
 include_directories(./)
 
 add_executable(citra-qt ${SRCS} ${MOC_SRCS} ${UI_HDRS})
-target_link_libraries(citra-qt core common qhexedit ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${SDL2_LIBRARY} rt GLEW ${GLFW_LIBRARIES})
+target_link_libraries(citra-qt core common video_core qhexedit ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${SDL2_LIBRARY} rt GLEW ${GLFW_LIBRARIES})
 
 #install(TARGETS citra-qt RUNTIME DESTINATION ${bindir})
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index d36304d911d8e9a6d2315d72108463caaa566ea7..47ad964dbbffa71e874f03975f48681240eb20c6 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -672,7 +672,7 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string &new
         else
             paths[D_USER_IDX] = std::string(getenv("HOME") ? 
                 getenv("HOME") : getenv("PWD") ? 
-                getenv("PWD") : "") + DIR_SEP DOLPHIN_DATA_DIR DIR_SEP;
+                getenv("PWD") : "") + DIR_SEP EMU_DATA_DIR DIR_SEP;
 #endif
 
         paths[D_CONFIG_IDX]            = paths[D_USER_IDX] + CONFIG_DIR DIR_SEP;
diff --git a/src/common/swap.h b/src/common/swap.h
index d07d9fcc5c673b71f66f0bc5609bbde5df0007df..123019fd173a589036ba20f37402d50f360dafab 100644
--- a/src/common/swap.h
+++ b/src/common/swap.h
@@ -497,27 +497,27 @@ typedef s64 s64_le;
 typedef float float_le;
 typedef double double_le;
 
-typedef swap_struct_t<u64, swap_64_t<u64>> u64_be;
-typedef swap_struct_t<s64, swap_64_t<s64>> s64_be;
+typedef swap_struct_t<u64, swap_64_t<u64> > u64_be;
+typedef swap_struct_t<s64, swap_64_t<s64> > s64_be;
 
-typedef swap_struct_t<u32, swap_32_t<u32>> u32_be;
-typedef swap_struct_t<s32, swap_32_t<s32>> s32_be;
+typedef swap_struct_t<u32, swap_32_t<u32> > u32_be;
+typedef swap_struct_t<s32, swap_32_t<s32> > s32_be;
 
-typedef swap_struct_t<u16, swap_16_t<u16>> u16_be;
-typedef swap_struct_t<s16, swap_16_t<s16>> s16_be;
+typedef swap_struct_t<u16, swap_16_t<u16> > u16_be;
+typedef swap_struct_t<s16, swap_16_t<s16> > s16_be;
 
 typedef swap_struct_t<float, swap_float_t<float> > float_be;
 typedef swap_struct_t<double, swap_double_t<double> > double_be;
 #else
 
-typedef swap_struct_t<u64, swap_64_t<u64>> u64_le;
-typedef swap_struct_t<s64, swap_64_t<s64>> s64_le;
+typedef swap_struct_t<u64, swap_64_t<u64> > u64_le;
+typedef swap_struct_t<s64, swap_64_t<s64> > s64_le;
 
-typedef swap_struct_t<u32, swap_32_t<u32>> u32_le;
-typedef swap_struct_t<s32, swap_32_t<s32>> s32_le;
+typedef swap_struct_t<u32, swap_32_t<u32> > u32_le;
+typedef swap_struct_t<s32, swap_32_t<s32> > s32_le;
 
-typedef swap_struct_t<u16, swap_16_t<u16>> u16_le;
-typedef swap_struct_t<s16, swap_16_t<s16>> s16_le;
+typedef swap_struct_t<u16, swap_16_t<u16> > u16_le;
+typedef swap_struct_t< s16, swap_16_t<s16> > s16_le;
 
 typedef swap_struct_t<float, swap_float_t<float> > float_le;
 typedef swap_struct_t<double, swap_double_t<double> > double_le;
@@ -532,4 +532,4 @@ typedef s64 s64_be;
 
 typedef float float_be;
 typedef double double_be;
-#endif
\ No newline at end of file
+#endif
diff --git a/src/core/arm/interpreter/armdefs.h b/src/core/arm/interpreter/armdefs.h
index 30b5b689c1e41ad1c8fd0e4a99c29891206355f1..821825ae61953798fc2ac76bf735ed1f3b3e8065 100644
--- a/src/core/arm/interpreter/armdefs.h
+++ b/src/core/arm/interpreter/armdefs.h
@@ -22,6 +22,8 @@
 #include <stdlib.h>
 #include <errno.h>
 
+#include "common/platform.h"
+
 #if EMU_PLATFORM == PLATFORM_WINDOWS
 #include <windows.h>
 #endif
diff --git a/src/core/file_sys/meta_file_system.cpp b/src/core/file_sys/meta_file_system.cpp
index 01048e4986319ff5a3358017d8434a11aaca27ec..4347ff451a1df9b82182fbdb342295c991f716b7 100644
--- a/src/core/file_sys/meta_file_system.cpp
+++ b/src/core/file_sys/meta_file_system.cpp
@@ -161,7 +161,7 @@ static bool RealPath(const std::string &currentDirectory, const std::string &inP
 
 IFileSystem *MetaFileSystem::GetHandleOwner(u32 handle)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	for (size_t i = 0; i < fileSystems.size(); i++)
 	{
 		if (fileSystems[i].system->OwnsHandle(handle))
@@ -173,7 +173,7 @@ IFileSystem *MetaFileSystem::GetHandleOwner(u32 handle)
 
 bool MetaFileSystem::MapFilePath(const std::string &_inpath, std::string &outpath, MountPoint **system)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	std::string realpath;
 
 	// Special handling: host0:command.txt (as seen in Super Monkey Ball Adventures, for example)
@@ -227,7 +227,7 @@ bool MetaFileSystem::MapFilePath(const std::string &_inpath, std::string &outpat
 
 void MetaFileSystem::Mount(std::string prefix, IFileSystem *system)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	MountPoint x;
 	x.prefix = prefix;
 	x.system = system;
@@ -236,7 +236,7 @@ void MetaFileSystem::Mount(std::string prefix, IFileSystem *system)
 
 void MetaFileSystem::Unmount(std::string prefix, IFileSystem *system)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	MountPoint x;
 	x.prefix = prefix;
 	x.system = system;
@@ -245,7 +245,7 @@ void MetaFileSystem::Unmount(std::string prefix, IFileSystem *system)
 
 void MetaFileSystem::Shutdown()
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	current = 6;
 
 	// Ownership is a bit convoluted. Let's just delete everything once.
@@ -267,7 +267,7 @@ void MetaFileSystem::Shutdown()
 
 u32 MetaFileSystem::OpenWithError(int &error, std::string filename, FileAccess access, const char *devicename)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	u32 h = OpenFile(filename, access, devicename);
 	error = lastOpenError;
 	return h;
@@ -275,7 +275,7 @@ u32 MetaFileSystem::OpenWithError(int &error, std::string filename, FileAccess a
 
 u32 MetaFileSystem::OpenFile(std::string filename, FileAccess access, const char *devicename)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	lastOpenError = 0;
 	std::string of;
 	MountPoint *mount;
@@ -291,7 +291,7 @@ u32 MetaFileSystem::OpenFile(std::string filename, FileAccess access, const char
 
 FileInfo MetaFileSystem::GetFileInfo(std::string filename)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	std::string of;
 	IFileSystem *system;
 	if (MapFilePath(filename, of, &system))
@@ -307,7 +307,7 @@ FileInfo MetaFileSystem::GetFileInfo(std::string filename)
 
 bool MetaFileSystem::GetHostPath(const std::string &inpath, std::string &outpath)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	std::string of;
 	IFileSystem *system;
 	if (MapFilePath(inpath, of, &system)) {
@@ -319,7 +319,7 @@ bool MetaFileSystem::GetHostPath(const std::string &inpath, std::string &outpath
 
 std::vector<FileInfo> MetaFileSystem::GetDirListing(std::string path)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	std::string of;
 	IFileSystem *system;
 	if (MapFilePath(path, of, &system))
@@ -335,13 +335,13 @@ std::vector<FileInfo> MetaFileSystem::GetDirListing(std::string path)
 
 void MetaFileSystem::ThreadEnded(int threadID)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	currentDir.erase(threadID);
 }
 
 int MetaFileSystem::ChDir(const std::string &dir)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	// Retain the old path and fail if the arg is 1023 bytes or longer.
 	if (dir.size() >= 1023)
 		return -1;//SCE_KERNEL_ERROR_NAMETOOLONG;
@@ -378,7 +378,7 @@ int MetaFileSystem::ChDir(const std::string &dir)
 
 bool MetaFileSystem::MkDir(const std::string &dirname)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	std::string of;
 	IFileSystem *system;
 	if (MapFilePath(dirname, of, &system))
@@ -393,7 +393,7 @@ bool MetaFileSystem::MkDir(const std::string &dirname)
 
 bool MetaFileSystem::RmDir(const std::string &dirname)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	std::string of;
 	IFileSystem *system;
 	if (MapFilePath(dirname, of, &system))
@@ -408,7 +408,7 @@ bool MetaFileSystem::RmDir(const std::string &dirname)
 
 int MetaFileSystem::RenameFile(const std::string &from, const std::string &to)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	std::string of;
 	std::string rf;
 	IFileSystem *osystem;
@@ -440,7 +440,7 @@ int MetaFileSystem::RenameFile(const std::string &from, const std::string &to)
 
 bool MetaFileSystem::RemoveFile(const std::string &filename)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	std::string of;
 	IFileSystem *system;
 	if (MapFilePath(filename, of, &system))
@@ -455,7 +455,7 @@ bool MetaFileSystem::RemoveFile(const std::string &filename)
 
 void MetaFileSystem::CloseFile(u32 handle)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	IFileSystem *sys = GetHandleOwner(handle);
 	if (sys)
 		sys->CloseFile(handle);
@@ -463,7 +463,7 @@ void MetaFileSystem::CloseFile(u32 handle)
 
 size_t MetaFileSystem::ReadFile(u32 handle, u8 *pointer, s64 size)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	IFileSystem *sys = GetHandleOwner(handle);
 	if (sys)
 		return sys->ReadFile(handle,pointer,size);
@@ -473,7 +473,7 @@ size_t MetaFileSystem::ReadFile(u32 handle, u8 *pointer, s64 size)
 
 size_t MetaFileSystem::WriteFile(u32 handle, const u8 *pointer, s64 size)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	IFileSystem *sys = GetHandleOwner(handle);
 	if (sys)
 		return sys->WriteFile(handle,pointer,size);
@@ -483,7 +483,7 @@ size_t MetaFileSystem::WriteFile(u32 handle, const u8 *pointer, s64 size)
 
 size_t MetaFileSystem::SeekFile(u32 handle, s32 position, FileMove type)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	IFileSystem *sys = GetHandleOwner(handle);
 	if (sys)
 		return sys->SeekFile(handle,position,type);
@@ -493,7 +493,7 @@ size_t MetaFileSystem::SeekFile(u32 handle, s32 position, FileMove type)
 
 void MetaFileSystem::DoState(PointerWrap &p)
 {
-	std::lock_guard<std::mutex> guard(lock);
+	std::lock_guard<std::recursive_mutex> guard(lock);
 	
 	auto s = p.Section("MetaFileSystem", 1);
 	if (!s)
diff --git a/src/core/file_sys/meta_file_system.h b/src/core/file_sys/meta_file_system.h
index 961f75cda4267a915783a549d94c5e894358af79..f358d8d5cf5ffb45cd51349de49462cb77a5cfeb 100644
--- a/src/core/file_sys/meta_file_system.h
+++ b/src/core/file_sys/meta_file_system.h
@@ -104,7 +104,7 @@ public:
 	// TODO: void IoCtl(...)
 
 	void SetStartingDirectory(const std::string &dir) {
-		std::lock_guard<std::mutex> guard(lock);
+		std::lock_guard<std::recursive_mutex> guard(lock);
 		startingDirectory = dir;
 	}
 };