public void removeKey(String var) {
        Boolean changed = false;

        if (this.props.containsKey(var)) {
            this.props.remove(var);
            changed = true;
        }

        // Use an iterator to prevent ConcurrentModification exceptions
        Iterator<String> it = this.lines.listIterator();
        while (it.hasNext()) {
            String line = it.next();

            if (line.trim().length() == 0) {
                continue;
            }

            if (line.charAt(0) == '#') {
                continue;
            }

            if (line.contains("=")) {
                int delimPosition = line.indexOf('=');
                String key = line.substring(0, delimPosition).trim();

                if (key.equals(var)) {
                    it.remove();
                    changed = true;
                }
            } else {
                continue;
            }
        }

        // Save on change
        if (changed) {
            save();
        }
    }