Fixed compile and test errors