Adding possibly unnecessary error handling to try and nail down loading bug.