bug fixes, minor edits