Change camelcase to underscores.
Fix bugs for first working version.