Updated based on github issues.