Fixed bug where association models were fetched by their alias instead of model names, plus added stack logging function