few compile bugs fixed