macosxinit: code check, fixed a few errors