Applied code review suggestions from @Ocramius.