(#873) Fix code stlye & test errors