bug fixes; var renames