Corrected some basic ruby mistakes in previous version.