committing patches supplied by Matthew McClain for bug 8757. This will handle most cases, since majority formulas expect value class params. Ptgs to be refactored for full functionality