Fix for errors found by netbeans ide