Couple of changes based on hadley's suggestions on my pull request