Update code as advised by FingBugs report