Added checks for old ruby. Otherwise there will be syntax errors