fixed a NPE that happens sometimes and added missing @Override annotations