Fixed compile bugs