refactored getEntryByPrimaryKey

+ var misc fixes to remove all yellow non-crit warnings