Fixing potential key errors on retrieving distribution