Improved version calculation and weight handling