2010-05-04: Updated code to remain compliant with most recent gcc changes (can no longer typecast lvals, "log" is now a gcc built-in function). Still needs documentation.