fix compile static issues and generic mess