Added to netbeans and fixed some warnings