Removed unused property and added paranoid check on generator function due to failure in some ES5 environments