Merge pull request #42 from amikheychik/master

Code-style fixes
Fix: check if entity cache enabled before using it