Fix the beta methods. Update code to use length instead of numel.