fixed warnigns and compiler errors for Ubuntu