cache parent bearing and fix numeric issue
fix several warnings, as well as link with libz for windows builds