Fixes model queries