Fixes syntax warnings
Changes to prevent further action once term entered