Fix Postgresql throw PDOException when id doesn't have expected type. (string instead of integer)
Refactoring.

Use of Comment constant in counterCacheScope.
Remove explicit boolan cast whitin tests.
Add more tests for code coverage's sake.