support for multiple archs
compilation fixes and cleanups