Fix style according to Longyi Qi' remarks.
Fix tests.