Changed 'logic' in AMD loading functions