Model layer querying bug fixes.