finish refactoring ruby files for style; one two tiny(probable?) bug fixes