Fixed some errors introduced in bd408eea760beed7b0f170e7e329eb3192ec4cf2