Check for nil value in stashes
Fix gem comparision for beta versions