Fixed some errors introduced by the big merge