Add version macros, some fixes