Cleaned up the previous pull requests because they completely broke the compile. @koray10: Please make sure that you check your code before submitting pull requests! Thanks! (admittedly, I should also have been more thorough before I approved them)