Cleaned up the merged mess to compile correctly