Fixed some errors that prevented the code from passing its unit tests in 1.8 mode