Fixed some problems on models and hooks