Fix some incorrect code