fixed bugs found from FIndBugs plugin